package com.ants.product.controller;

import com.ants.common.product.Product;
import com.ants.product.service.ProductService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author 蚂蚁会花呗
 * @create 2025/5/22 9:51
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @Resource
    private ProductService productService;

    @GetMapping("/{pid}")
    public Product product(@PathVariable("pid") Integer pid) {
        Product product = productService.getEntity(pid);
        return product;
    }

    @GetMapping("testOauth2")
    public String testOauth2(){
        return "这是测试白名单，静态资源";
    }


}
